Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix server shutdown race #2958

Merged

Conversation

2opremio
Copy link
Contributor

Instead of using locks I simply initialize the servers during creation.
In that way there are no writes while serving.

Fixes #2957

Instead of using locks I simply initialize the servers during creation.
In that way there are no writes while serving.
@2opremio 2opremio requested a review from bartekn August 26, 2020 20:54
@cla-bot cla-bot bot added the cla: yes label Aug 26, 2020
@bartekn
Copy link
Contributor

bartekn commented Aug 27, 2020

It fails with:

FATA[2020-08-27T15:50:59.331+02:00] server already started                        pid=32074

possibly because of:

	if s.server != nil {
		return errors.New("server already started")
	}

@bartekn bartekn linked an issue Aug 27, 2020 that may be closed by this pull request
@2opremio
Copy link
Contributor Author

@bartekn it should be good to go.

services/horizon/internal/httpx/server.go Outdated Show resolved Hide resolved
services/horizon/internal/app.go Outdated Show resolved Hide resolved
@2opremio 2opremio merged commit c04e991 into stellar:release-horizon-v1.8.0 Aug 28, 2020
@2opremio 2opremio deleted the fix-server-shutdown-race branch August 28, 2020 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data race in services/horizon/internal/httpx.(*Server).Shutdown
2 participants